#字符串重复统计
#字符表'abcdefghijklmnopqrstuvwxyz'
#随机挑选2个字母组成字符串，共挑选100个
#降序输出所有不同的字符串及重复的次数
import random
sample = 'abcdefghijklmnopqrstuvwxyz'
my_list = ["".join(random.sample(sample,2)) for _ in range(100) ]

newdict = {}

for i in my_list:
    count=0
    if i in newdict:
        count += 1
    else:
        newdict[i] = 0

final = sorted(newdict.items(), key=lambda item:item[0],reverse = True)
print(final)

# 和第二题一样，结果有问题，你自己执行下，看看问题出在哪里
